<?php
require_once('db.php');
$id = isset($_GET['id'])?$_GET['id']:0;
$user = findById('users', $id);
$isActive = ($user['status']=='1')?'checked':'';
$isInactive = ($user['status']=='0')?'checked':'';
pr($user);
?>

<link href="css/form.css" rel="stylesheet" type="text/css" />

<form action="edit_saveuser.php" method="post">
<input type="text" name="id" value="<?=$user['id']?>" />
<table width="80%" border="1" cellpadding="5" cellspacing="0">
  <thead>
    <tr>
      <th colspan="2">Edit User</th>
    </tr>
  </thead>
  <tbody>

    <tr>
      <td align="right" style="font-weight:bold">Name :</td>
      <td ><input type="text" name="name" required placeholder="My Name is.." value="<?=$user['name']?>"/></td>
    </tr>

    <tr>
      <td align="right" style="font-weight:bold">Email :</td>
      <td ><input autocomplete="off" type="email" required name="email"  value="<?=$user['email']?>" placeholder="My Email is.." /></td>
    </tr>

    <tr>
      <td align="right" style="font-weight:bold">Status :</td>
      <td >
        <input value="1" <?=$isActive?> type="radio" name="status"  /> Active
        <input value="0" <?=$isInactive?> type="radio" name="status"  /> Inactive
      </td>
    </tr>

    <tr>
      <td align="right" style="font-weight:bold">&nbsp;</td>
      <td ><input type="submit" name="submit"  value="Update Me!!" /></td>
    </tr>

  </tbody>
</table>

</form>
